class CarBrandsController < ApplicationController
  # GET /car_brands
  # GET /car_brands.xml
  def index
    @car_brands = CarBrand.all

    respond_to do |format|
      format.html # index.html.erb
      format.xml  { render :xml => @car_brands }
    end
  end

  # GET /car_brands/1
  # GET /car_brands/1.xml
  def show
    @car_brand = CarBrand.find(params[:id])

    respond_to do |format|
      format.html # show.html.erb
      format.xml  { render :xml => @car_brand }
    end
  end

  # GET /car_brands/new
  # GET /car_brands/new.xml
  def new
    @car_brand = CarBrand.new

    respond_to do |format|
      format.html # new.html.erb
      format.xml  { render :xml => @car_brand }
    end
  end

  # GET /car_brands/1/edit
  def edit
    @car_brand = CarBrand.find(params[:id])
  end

  # PUT /car_brands/1
  # PUT /car_brands/1.xml
  def update
    @filter = Filter.find(params[:id])

    respond_to do |format|
      if @filterd.update_attributes(params[:car_brand])
        format.html { redirect_to(admin_path, :notice => 'Car brand was successfully updated.') }
      else
        format.html { render :action => "edit" }
      end
    end
  end

  def destroy
    @car_brand = CarBrand.find(params[:id])
    @car_brand.destroy

    respond_to do |format|
      format.html { redirect_to(car_brands_url) }
      format.xml  { head :ok }
    end
  end
end
